!function(t){var n={};function o(r){if(n[r])return n[r].exports;var i=n[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,o),i.l=!0,i.exports}o.m=t,o.c=n,o.d=function(t,n,r){o.o(t,n)||Object.defineProperty(t,n,{enumerable:!0,get:r})},o.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},o.t=function(t,n){if(1&n&&(t=o(t)),8&n)return t;if(4&n&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(o.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&n&&"string"!=typeof t)for(var i in t)o.d(r,i,function(n){return t[n]}.bind(null,i));return r},o.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return o.d(n,"a",n),n},o.o=function(t,n){return Object.prototype.hasOwnProperty.call(t,n)},o.p="/",o(o.s=108)}({1:function(t,n,o){"use strict";function r(t){return t?Object.keys(t).map((function(n){var o=t[n],r=encodeURIComponent(n),i=null==o?"":encodeURIComponent(o);return"".concat(r,"=").concat(i)})).join("&"):""}function i(t,n){return Object.prototype.hasOwnProperty.call(t,n)}function a(t){for(var n=Object(t),o=1;o1&&void 0!==arguments[1]?arguments[1]:null,o=arguments.length>2?arguments[2]:void 0,i=n?"?".concat(Object(r.c)(n)):"",a=new Image,c="".concat(t).concat(i);window.em_pixels[c]=a,a.src=c;var u=function(){o&&o(a),delete window.em_pixels[c]};return a.complete||4===a.readyState?u():a.onload=u,a}window.em_pixels={};var a=Object({NODE_ENV:"production",BUILD_HASH:"b21b8ec",TAG_BASE_URL:"t.effectivemeasure.net",COLLECTOR_BASE_URL:"collector.effectivemeasure.net",SURVEY_BASE_URL:"survey.effectivemeasure.net",SURVEY_UI_BASE_URL:"survey-ui.effectivemeasure.net"}),c=a.NODE_ENV,u=a.COLLECTOR_BASE_URL,s=a.TAG_BASE_URL,l=a.SURVEY_BASE_URL,f=a.SURVEY_UI_BASE_URL,d=a.BUILD_HASH,p="production"===c,v=p?"https:":window.location.protocol,h=p,g=d,m=s.substr(0,s.indexOf(".")),k="".concat(v,"//").concat(u,"/pixel"),y="".concat(v,"//").concat(u,"/beacon/get"),w="".concat(v,"//").concat(u,"/beacon/set"),C="".concat(v,"//").concat(u,"/errpixel"),b="".concat(v,"//").concat(f,"/survey.js"),S="".concat(v,"//").concat(s,"/debug.").concat(d,".js"),O="".concat(v,"//").concat(s,"/polyfills.").concat(d,".js"),_="".concat(v,"//detect-survey.effectivemeasure.net/detect"),x="".concat(v,"//").concat(l,"/launchConfigs"),V="".concat(v,"//").concat(l,"/surveyConfig"),M="".concat(v,"//").concat(u,"/sync_pixels"),A="".concat(v,"//").concat(u,"/sync_webhook");function P(t,n){var o=window.em_event_emitter||{};o[t]?o[t].push(n):o[t]=[n],window.em_event_emitter=o}function j(t,n){for(var o=t.length>>>0,r=0;r>>0,r=[],i=0;i-1?"&":"?";return"".concat(t).concat(n,"_em_debug=").concat(this.debugStr)}},{key:"getOverrides",value:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,o=j(this.overrides,(function(n){return n[0]===t}));return this.isDebugging&&o&&o[1]||n}}])&&D(n.prototype,o),i&&D(n,i),t}());function I(t){var n=document.getElementsByTagName("script")[0],o=document.createElement("script");return o.async=!0,o.src=t,n.parentNode.insertBefore(o,n)}var R=function(){return function t(n){return n?(n^16*Math.random()>>n/4).toString(16):([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g,t)}()},N=function(){for(var t,n=[],o=0;o<256;o+=1){t=o;for(var r=0;r<8;r+=1)t=1&t?3988292384^t>>>1:t>>>1;n[o]=t}return n}();var L=/^[0-9a-fA-f]{19}([0-9a-fA-f]{23}-\d{8})[0-9a-fA-f]{8}$/,B=/^[0-9a-fA-f]{19}([0-9a-fA-f]{8}-[0-9a-fA-f]{4}-[0-9a-fA-f]{4}-[0-9a-fA-f]{4}-[0-9a-fA-f]{12})[0-9a-fA-f]{8}$/,F=/^([0-9a-fA-f]{8}-[0-9a-fA-f]{4}-[0-9a-fA-f]{4}-[0-9a-fA-f]{4}-[0-9a-fA-f]{12})-[0-9a-fA-f]{11}-[0-9a-fA-f]{8}$/,H=/^([0-9a-fA-f]{23}-\d{8})-[0-9a-fA-f]{11}-[0-9a-fA-f]{8}$/;function $(t,n){var o=t&&t.match&&t.match(n);return o?o[1]:null}function q(t){var n=t||R(),o=(+new Date).toString(16),r="".concat(n,"-").concat(o),i=function(t){for(var n=-1,o=0;o>>8^N[255&(n^t.charCodeAt(o))];return(-1^n)>>>0}(r).toString(16),a="00000000".concat(i).slice(-8);return"".concat(r,"-").concat(a)}function J(t){return $(t,L)||$(t,B)}function Y(t){return $(t,F)||$(t,H)}function G(t){var n,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;try{n=JSON.parse(t)}catch(t){n=o}return n}var X=function(t){return null===t?null:String(t)},z={toString:X,fromString:function(t){return t}},W={toString:X,fromString:function(t){return function(t){var n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],o=J(t);if(o)return q(o);var r=Y(t),i=n?q():null;return r?t:i}(t)}},K={toString:X,fromString:function(t){if(null===t)return null;var n=parseInt(t||0,10);return 0===n||n>0?n:null}},Q={toString:function(t){return null===t?null:t?"1":"0"},fromString:function(t){var n=null;return"1"===t?n=!0:"0"===t&&(n=!1),n}},Z={toString:function(t){return null===t?t:JSON.stringify(t)},fromString:function(t){return G(t)}};function ee(t,n){return function(t){return Date.now()-parseInt(t,10)}(t)/864e5<=n}var te,ne="vt",oe="vi",re=(te=1800,new Date(Date.now()+1e3*te).toString()),ie=[{name:ne,third:!0,option:{expires:360},serialiser:W},{name:"opt_out",third:!0,option:{expires:360},serialiser:Q},{name:oe,option:{expires:re},serialiser:W},{name:"lt",option:{expires:re},serialiser:K},{name:"ft",option:{expires:re},serialiser:K},{name:"pc",option:{expires:re},serialiser:K},{name:"c3",third:!0,option:{expires:re},serialiser:Q},{name:"slr",third:!0,option:{expires:re},serialiser:K},{name:"slc",third:!0,option:{expires:re},serialiser:K},{name:"scf",option:{expires:re},serialiser:Z},{name:"dmp",third:!0,option:{expires:360},serialiser:K},{name:"gc",third:!0,option:{expires:360},serialiser:z},{name:"mb",third:!0,option:{expires:360},serialiser:Q}];function ae(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,o=new Error(t);return n&&(o.options=n),o}function ce(t,n){var o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,r=!0,i=t&&t.split("?")[0];return new Promise((function(a,c){var u;try{(u=new XMLHttpRequest).open(n,t,r)}catch(t){c(ae("Ajax err (".concat(t,") to ").concat(i),{throttleOption:"h6"}))}u.onreadystatechange=function(){if(4===u.readyState)if(200===u.status)a(u.responseText);else{var t="Ajax failed (status: ".concat(u.status,") to ").concat(i),n=0===u.status?"d1":"h6";c(ae(t,{throttleOption:n}))}},u.onerror=function(t){c(ae("Ajax err (".concat(t,") to ").concat(i),{throttleOption:"h6"}))},"POST"===n&&u.setRequestHeader("Content-type","application/json"),u.send(o)}))}function ue(t){return G(t,t)}function se(t,n){var o=Object(r.c)(n);return ce("".concat(t,"?").concat(o),"GET",null).then(ue)}function le(t,n){return ce(t,"POST",JSON.stringify(n)).then(ue)}function fe(t,n){for(var o=0;o0&&o.loadSurveyConfig({id:t,url:U.getOverrides("survey_url",n.pageUrl)}).then((function(t){if(t&&t.id>0){var o={survey:t,meta:{visitor_id:n.getVisitorId(),country:t.meta.country,device:t.meta.mobile?1:0,origin:n.pageUrl,test:U.isDebugging,tag_vn:"".concat("t.effectivemeasure.net","@").concat(g)}};P("survey_complete",(function(){return function(t){t.cookieManager.setCookieValue("slc",Date.now()),t.cookieManager.saveFirstPartyCookies(["slc"]),t.cookieManager.saveThirdPartyCookies(["slc"])}(n)})),P("survey_reject",(function(){return function(t){t.cookieManager.setCookieValue("slr",Date.now()),t.cookieManager.saveFirstPartyCookies(["slr"]),t.cookieManager.saveThirdPartyCookies(["slr"])}(n)})),window.runSurvey=function(t){return t.start(o)},I(b)}})).catch(pe)}function he(){var t=window.permutive;t&&t.ready&&t.ready((function(){var n=t.context&&t.context.user_id,o="".concat(A,"/permutive/").concat(n);n&&(t.identify([{tag:"narratiive_id",id:n}]),i(o))}))}var ge={send:function(t){var n=t.context,o=function(t){var n=t&&t[0],o=t&&t.slice(1)||[];return o=(o=E(o=o.map((function(t){return t&&String(t).replace(/\W/g,"_")||""})),(function(t){return""!==t}))).join(" "),("token"===n&&""===o||-1===T.indexOf(n))&&(n=null),{eventType:n,eventData:o}}(t.data),a=o.eventType,c=o.eventData;if(null!==a&&function(t){return!t.detectOptedOut()}(n)){var u=n.getData();if("ajax"===a){var s=1*new Date;u.pu="".concat(n.pageUrl,"#").concat(s),n.refresh()}var l=Object(r.b)({},{et:a,ed:c},u);i(k,l,(function(){return function(t,n){((window.em_event_emitter||{})[t]||[]).forEach((function(t){return t(n)}))}("tagging:plugin:send",l)}))}},survey:function(t){var n=t.context;U.isDebugging?ve(U.getOverrides("survey_id"),n):function(t){var n=t.cookieManager;if(!t.browserSupport.isInIframe&&t.detectCrossSiteSupport()){var o=n.getCookieValue("slc"),r=n.getCookieValue("slr"),i=o>0&&ee(o,120),a=r>0&&ee(r,30);return!i&&!a}return!1}(n)&&function(t){var n,o,r,i,a=t.cookieManager.getCookieValue("scf"),c=new de(t);return a?Promise.resolve(a):c.loadLaunchConfigs({url:U.getOverrides("survey_url",t.pageUrl),lang:U.getOverrides("survey_lang",(n=document.documentElement,o=n.attributes["xml:lang"],r=o&&o.value,i=n.lang||r,i&&i.toLowerCase().split("-").shift())),visitorId:t.getVisitorId(),lastCompleted:t.cookieManager.getCookieValue("slc")}).then((function(n){return t.cookieManager.setCookieValue("scf",n||[]),t.cookieManager.saveFirstPartyCookies(["scf"]),n}))}(n).then((function(t){return ve(function(t,n){var o=t&&j(t,(function(t){var o=!t.host||0===n.hostname.indexOf(t.host),r=!t.path||n.pathname.match(t.path);return o&&r}));return o?o.id:null}(t,n),n)})).catch(pe)},watch:function(t){var n=t.data;P(n[0],n[1])},sync:function(t){var n=t.context;if(function(t){var n=t.cookieManager;if(!t.browserSupport.isInIframe&&t.detectCrossSiteSupport()){var o=n.getCookieValue("dmp"),r=o&&parseInt(o,10),i=parseInt((new Date).getTime(),10),a=!r||i-r>6048e5;return t.pageUrl&&a}return!1}(n)){var o={pageURL:n.pageUrl,vt:n.getVisitorCookie()};se(M,o).then((function(t){return Array.isArray(t)&&t.map((function(t){return i(t)}))})).then(he).then((function(){return n.cookieManager.setCookieValue("dmp",Date.now()),n.cookieManager.saveFirstPartyCookies(["dmp"]),n.cookieManager.saveThirdPartyCookies(["dmp"])})).catch(pe)}}},me=o(9),ke=o.n(me);var ye=function(){for(var t=function(t){ke.a.set("foo","bar",{domain:t});var n="bar"===ke.a.get("foo");return ke.a.erase("foo",{domain:t}),n},n=window.location&&window.location.hostname,o=n?n.split("."):[],r=2;r<=o.length;r+=1){var i=".".concat(o.slice(-1*r).join("."));if(t(i))return i}return""}();function we(t,n){var o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],a=i?{domain:ye}:{};ke.a.set(t,String(n),Object(r.b)({},a,o))}function Ce(){ke.a.set("foo","bar");var t="bar"===ke.a.get("foo");return ke.a.erase("foo"),t}function be(){try{return window.self!==window.top}catch(t){return!0}}var Se=(new Date).getTime(),Oe=0;function _e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Oe+=1;var o="cb".concat(Se,"_").concat(Oe),i=new Promise((function(t,n){window[o]=function(n){t(n),delete window[o]},setTimeout((function(){n(ae("jsonp timeout",{throttleOption:"h6"})),delete window[o]}),1e4)})),a=n||{};a.callback=o;var c=Object(r.c)(a),u="".concat(t,"?").concat(c);return I(u),i}function xe(t,n){for(var o=0;o=0})).forEach((function(t){var o=n.getCookieValue(t),r=n.cookieOptions[t]||{},i=n.cookieSerialisers[t].toString(o);null!==i&&we("_em_".concat(t),i,r)}))}},{key:"saveThirdPartyCookies",value:function(t){var n=this,o=E(this.thirdCookieNames,(function(n){return t.indexOf(n)>=0})),r={};return o.forEach((function(t){var o=n.getCookieValue(t),i=n.cookieSerialisers[t].toString(o);null!==i&&(r[t]=i)})),_e(w,{cookies:JSON.stringify(r)})}},{key:"removeCookies",value:function(){var t=this;this.allCookieNames.map((function(n){var o=t.cookieOptions[n]||{};return{name:n,value:null,option:Object(r.b)({},o,{expires:-1})}})).forEach((function(t){var n=t.name,o=t.value,r=t.option;"opt_out"!==n&&we("_em_".concat(n),o,r)}))}},{key:"setCookieValue",value:function(t,n){void 0!==n&&(this.cookieValues[t]=n)}},{key:"getCookieValue",value:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return void 0!==this.cookieValues[t]?this.cookieValues[t]:n}}])&&xe(n.prototype,o),i&&xe(n,i),t}();function Me(t,n){for(var o=0;o0?i-a:0;return{br:m,vn:g,tz:(new Date).getTimezoneOffset()/-60,pu:this.pageUrl,vt:this.cookieManager.getCookieValue(ne),vi:this.cookieManager.getCookieValue(oe),du:c,dt:this.browserSupport.doNotTrack?"1":"0",c1:this.browserSupport.supportsCookie?"1":"0",c3:this.detectCrossSiteSupport()?"1":"0",pc:this.cookieManager.getCookieValue("pc"),db:o?"1":"0",pr:this.referrer===this.pageUrl?null:this.referrer,tt:t.trim(),te:r,sh:n.height,sw:n.width}}},{key:"getVisitorCookie",value:function(){return this.cookieManager.getCookieValue(ne)}},{key:"getVisitorId",value:function(){return J(t=this.getVisitorCookie())||Y(t);var t}}])&&Me(n.prototype,o),r&&Me(n,r),t}();function Pe(t,n){for(var o=0;o=0?";expires="+p.toUTCString():"")+(u?";domain="+u:"")+(s?";path="+s:"")+(l?";secure":"")+(f?";httponly":"")+(d?";samesite="+d:"")},n.get=function(t){for(var n=document.cookie.split(";");n.length;){var o=n.pop(),r=o.indexOf("=");if(r=r<0?o.length:r,decodeURIComponent(o.slice(0,r).replace(/^\s+/,""))===t)return decodeURIComponent(o.slice(r+1))}return null},n.erase=function(t,o){n.set(t,"",{expires:-1,domain:o&&o.domain,path:o&&o.path,secure:0,httponly:0})},n.all=function(){for(var t={},n=document.cookie.split(";");n.length;){var o=n.pop(),r=o.indexOf("=");r=r<0?o.length:r,t[decodeURIComponent(o.slice(0,r).replace(/^\s+/,""))]=decodeURIComponent(o.slice(r+1))}return t}}}); //# sourceMappingURL=tag.b21b8ec.map.js